import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    viteStaticCopy({
      targets: [
        {
          src: 'node_modules/scichart/_wasm/scichart2d.data',
          dest: '',
        },
        {
          src: 'node_modules/scichart/_wasm/scichart2d.wasm',
          dest: '',
        },
      ],
    }),
  ],
  server: {
    host: '0.0.0.0',
    port: 5173, // 端口号
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
});
